#ifndef _SPI_H_
#define _SPI_H_

#ifdef __cplusplus
 extern "C" {
#endif

#include "stm32f10x.h"

#include "delay.h"
     
typedef struct _cGpio{
    GPIO_TypeDef * port;
    uint32_t num;
    uint32_t pin;
}cGpio_T;     
     
     
     
typedef struct{
    cGpio_T MOSI;
    cGpio_T MISO;
    cGpio_T SCK;
    cGpio_T NSS;
}SpiPort_T;

void Board_SPI1_Init(void);        
void Board_SPI3_Init(void);     
void Board_SPI1_SetSpeed(u8 SpeedSet); 
u8 Board_SPI1_ReadWriteByte(u8 TxData);
u8 Board_SPI3_ReadWriteByte(u8 TxData);
     
#ifdef __cplusplus
 }
#endif

#endif
